This folder contains the files needed to replicate Mattingly and Sundquist (2022)
''When Does Public Diplomacy Work? Evidence From China's 'Wolf Warrior' Diplomats''


Filename				Description
----------------------------------------------------
ReadMe.txt			You are here.
Codebook.docx			Explanation of variable names
twitter_diplomacy_data.csv	Primary dataset
Replication_main_results.R	Code to produce published figures.
A1.R				Code to produce Appendix 1 (descriptive statistics).
A5_part_1.R			Code to produce Appendix 5 (PCA loadings).
A5_part_2.R			Re-runs main analysis with PCA fitted separately by wave.
A6.R				Code to produce Appendix 6 (individual question results).
A7.R				Code to produce Appendix 7 (ITT and Bonferroni correction).
A8.R				Code to produce Appendix 8 (Covariate balance).
wave1_both_loadings.RData		Used in A7.R. Constructed in A5 part 1.
wave2_both_loadings.RData		Used in A7.R. Constructed in A5 part 1.
allobs.csv			Includes suspected duplicate submissions. Used in A8.R
log_main.log			Log for Replication_main_results.R
log_A1.log			Log for A1.R
log_A5_1.log			Log for A5_part_1.R
log_A5_2.log			Log for A5_part_2.R
log_A6.log			Log for A6.R
log_A7.log			Log for A7.R
log_A8.log			Log for A8.R


Software version information:

These scripts were written with R version 4.1.2
They were created and tested on Mac OS X (11.6.5).
The following R package versions were used:
tidyverse_1.3.1
estimatr_0.30.2
coefplot_1.2.7
rio_0.5.29
xtable_1.8-4
gridExtra_2.3
ggpubr_0.4.0